<div class="row-fluid">

    <ul class="products">

        <?php foreach($products1 as $p): ?>
        <li class="span3">
            <div class="thumbnail">
                <div class="caption">
                    <h5><a style="color: black;" href="<?php echo site_url(); ?>/detail/<?php echo $p['product_id']; ?>"><?php echo $p['product_name']; ?></a></h5>
                </div>
                <p align="center">
                    <a href="<?php echo site_url(); ?>/detail/<?php echo $p['product_id']; ?>" >
                        <img class="product-img" src="<?php echo base_url('assets/'); ?>/img/placehold200200.png" data-original="<?php echo base_url('assets'); ?>/img/product/<?php echo $p['product_id']; ?>L1.jpg" alt="">
                    </a>
                </p>

                <div class="caption">
                    <h5>Price: <span class="price"><?php echo number_format($p['product_price'] * 1000000); ?> VND</span></h5>
                    <label class="control-label">Quantity</label>

                    <form class="form-inline" action="" method="" accept-charset="utf-8">
                        <div class="row-fluid">
                            <div class="span2"></div>
                            <div class="span8">
                                <input class="input-mini" type="text" name="quantity" value="1" maxlength="2" style="display: inline; width: 20px;">
                                <input type=hidden name="product_id" value="<?php echo $p['product_id'] ?>">
                                <input type="submit" value="Buy" class="btn btn-primary btn-small" style="display: inline; margin-top: 0px;" name="add">
                            </div>
                            <div class="span2"></div>
                        </div>
                    </form>
                </div>
            </div>
        </li>

        <?php endforeach; ?>
    </ul>
</div>

<?php
    if (count($products2) > 0){
        echo "<hr/>";
    }
?>

<div class="row-fluid">

    <ul class="products">

        <?php foreach($products2 as $p): ?>
        <li class="span3">
            <div class="thumbnail">
                <div class="caption">
                    <h5><a style="color: black;" href="<?php echo site_url(); ?>/detail/<?php echo $p['product_id']; ?>"><?php echo $p['product_name']; ?></a></h5>
                </div>
                <p align="center">
                    <a href="<?php echo site_url(); ?>/detail/<?php echo $p['product_id']; ?>" >
                        <img class="product-img" src="<?php echo base_url('assets/'); ?>/img/placehold200200.png" data-original="<?php echo base_url('assets'); ?>/img/product/<?php echo $p['product_id']; ?>L1.jpg" alt="">
                    </a>
                </p>
                <div class="caption">
                    <h5>Price: <span class="price"><?php echo number_format($p['product_price'] * 1000000); ?> VND</span></h5>
                    <label class="control-label">Quantity</label>

                    <form class="form-inline" action="<?php echo base_url(); ?>index.php/cart/add_cart_item" method="post" accept-charset="utf-8">
                        <div class="row-fluid">
                            <div class="span2"></div>
                            <div class="span8">
                                <input class="input-mini" type="text" name="quantity" value="1" maxlength="2" style="display: inline; width: 20px;">
                                <input type=hidden name="product_id" value="<?php echo $p['product_id'] ?>">
                                <input type="submit" value="Buy" class="btn btn-primary btn-small" style="display: inline; margin-top: 0px;" name="add">
                            </div>
                            <div class="span2"></div>
                        </div>
                    </form>
                </div>
            </div>
        </li>

        <?php endforeach; ?>
    </ul>
</div>

<?php
if (count($products3) > 0){
        echo "<hr/>";
    }
?>

<div class="row-fluid">

    <ul class="products">

        <?php foreach($products3 as $p): ?>
        <li class="span3">
            <div class="thumbnail">
                <div class="caption">
                    <h5><a style="color: black;" href="<?php echo site_url(); ?>/detail/<?php echo $p['product_id']; ?>"><?php echo $p['product_name']; ?></a></h5>
                </div>
                <p align="center">
                    <a href="<?php echo site_url(); ?>/detail/<?php echo $p['product_id']; ?>" >
                        <img class="product-img" src="<?php echo base_url('assets/'); ?>/img/placehold200200.png" data-original="<?php echo base_url('assets'); ?>/img/product/<?php echo $p['product_id']; ?>L1.jpg" alt="">
                    </a>
                </p>
                <div class="caption">
                    <h5>Price: <span class="price"><?php echo number_format($p['product_price'] * 1000000); ?> VND</span></h5>
                    <label class="control-label">Quantity</label>

                    <form class="form-inline" action="<?php echo base_url(); ?>index.php/cart/add_cart_item" method="post" accept-charset="utf-8">
                        <div class="row-fluid">
                            <div class="span2"></div>
                            <div class="span8">
                                <input class="input-mini" type="text" name="quantity" value="1" maxlength="2" style="display: inline; width: 20px;">
                                <input type=hidden name="product_id" value="<?php echo $p['product_id'] ?>">
                                <input type="submit" value="Buy" class="btn btn-primary btn-small" style="display: inline; margin-top: 0px;" name="add">
                            </div>
                            <div class="span2"></div>
                        </div>
                    </form>
                </div>
            </div>
        </li>

        <?php endforeach; ?>
    </ul>
</div>

<?php echo $this->pagination->create_links(); ?>